package cn.com.homeyoda.aimate.aihealth.ui.bluetooth;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yasee.yasee.protocols.ble.BleDevice;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.bean.FeedbackTypeBean;

/**
 * Created By 刘纯贵
 * Created Time 2020/4/30
 */
public class BluetoothListAdapter extends BaseQuickAdapter<BleDevice, BaseViewHolder> {

    private Context mContext;
    public Set<Integer> selectedItems = new HashSet<>();

    public BluetoothListAdapter(int layoutResId, @Nullable List<BleDevice> data, Context context) {
        super(layoutResId, data);
        mContext = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, BleDevice item) {

    }


    @Override
    public void onBindViewHolder(BaseViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);
        BleDevice item = getItem(position);
        holder.setText(R.id.device_xinghao, item.getModel());
        String mac = item.getMac();
        String result = mac.replace(":", "");
        holder.setText(R.id.device_bianhao, result);

        holder.addOnClickListener(R.id.link);
    }



    public Set<Integer> getSelectedItems() {
        return selectedItems;
    }

    @Override
    public void setNewData(@Nullable List<BleDevice> data) {
        super.setNewData(data);
    }
}
